package com.lc.feign;

import com.lc.entity.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Author:LC
 * Version:jdk-8u301
 * Date: 2022/7/19 11:02
 */
@FeignClient(value = "order-service")
public interface UserDoOrderFeign {

    /*
    需要将order-service（目标服务）中controller的方法，以接口的形式写在此处
     */

    @GetMapping("/doOrder")
    public String doOrder();

    @GetMapping("/getOneParam")
    public String getOneParam(@RequestParam("name") String name);

    @GetMapping("/getTwoParam")
    public String getTwoParam(@RequestParam("name") String name, @RequestParam("age") Integer age);

    @PostMapping("/postOneParamOneObj")
    public String postOneParamOneObj(@RequestBody Order order, @RequestParam("name") String name);

}
